from django.db import models

# Create your models here.


class Author(models.Model):
    aname = models.CharField("作者", max_length=50)

    def __str__(self):
        return f"{self.id}--{self.aname}"


class Book(models.Model):
    bname = models.CharField("书名", max_length=50)
    author = models.ManyToManyField(Author)

    def __str__(self):
        return f"{self.id}--{self.bname}"